package com.jrx.anytxn.reporting.service;

import com.jrx.anytxn.accounting.entity.GaVoucherInfo;
import com.jrx.anytxn.common.exception.TxnBizException;
import com.jrx.anytxn.common.exception.TxnException;
import com.jrx.anytxn.customer.entity.CmCustomerFirstLevel;
import com.jrx.anytxn.reporting.entity.AmRepaymentPlanInfo;
import com.jrx.anytxn.reporting.entity.AmlIATrading;
import com.jrx.anytxn.reporting.entity.CmInteCoAcctntEntryDtl;
import com.jrx.anytxn.reporting.entity.CmInteCoImpairmentInfo;
import com.jrx.anytxn.reporting.entity.CmInteCoLonInfo;
import com.jrx.anytxn.reporting.entity.CmInteCoLonInfoBean;
import com.jrx.anytxn.reporting.entity.CmInteCoLonInfoCi;
import com.jrx.anytxn.reporting.entity.CmInteCoLonRepayDtl;
import com.jrx.anytxn.reporting.entity.CmInteCoLonRepayDtlCi;
import com.jrx.anytxn.reporting.entity.CmInteCoLonRepayPlan;
import com.jrx.anytxn.reporting.entity.ModifyCmInteCoLonInfo;
import com.jrx.anytxn.transaction.entity.AmLoanMainInfo;
import com.jrx.anytxn.transaction.entity.TlInterestAccrualLog;
import com.jrx.anytxn.transaction.entity.TlPaymentLog;

import java.util.Date;
import java.util.List;

public interface IXibService {

    /**
     * 根据客户一级信息统计贷款信息
     * @param cmCustomerFirstLevel
     * @return
     */
    CmInteCoLonInfoBean assemLoanInfo(CmCustomerFirstLevel cmCustomerFirstLevel) throws TxnException;

    /**
     * 根据客户一级信息统计贷款信息 (兴安借)
     * @param loanInfo
     * @return
     */
    CmInteCoLonInfoBean assemLoanInfoXaj(CmInteCoLonInfo loanInfo) throws TxnException;

    /**
     * 根据客户信息统计客户当日还款信息
     * @param cmCustomerFirstLevel
     * @return
     * @throws TxnException
     */
    CmInteCoLonRepayDtl assemRepayDtl(CmCustomerFirstLevel cmCustomerFirstLevel) throws TxnException;

    /**
     * 根据客户信息统计客户当日还款信息 (兴安借)
     * @param repayDtlCi
     * @return
     * @throws TxnException
     */
    CmInteCoLonRepayDtl assemXajRepayDtl(CmInteCoLonRepayDtl repayDtlCi) throws TxnException;

    /**
     * 处理传票流水
     * @param gaVoucherInfo
     * @return
     * @throws TxnException
     */
    CmInteCoAcctntEntryDtl assemAcctntDtl(GaVoucherInfo gaVoucherInfo) throws TxnException;

    /**
     * 处理减值入账信息
     * @param gaVoucherInfo
     * @return
     */
    CmInteCoImpairmentInfo assemImpairment(GaVoucherInfo gaVoucherInfo) throws TxnBizException;

    /**
     * 处理反洗钱信息（借款）
     * @param amLoanMainInfo
     * @return
     */
    AmlIATrading assemTrading(AmLoanMainInfo amLoanMainInfo) throws TxnBizException;

    /**
     * 处理反洗钱信息（还款）
     * @param tlPaymentLog
     * @return
     */
    List<AmlIATrading> assemPaymentTrading(TlPaymentLog tlPaymentLog) throws TxnBizException;

    /**
     * 处理还款计划
     * @param cmCustomerFirstLevel
     * @return
     * @throws TxnException
     */
    CmInteCoLonRepayPlan assemPlan(CmCustomerFirstLevel cmCustomerFirstLevel) throws TxnException;

    /**
     * 处理反洗钱信息（利息，罚息计提）
     * @param tlInterestAccrualLog
     * @return
     */
    AmlIATrading assemAccrued(TlInterestAccrualLog tlInterestAccrualLog) throws TxnBizException;

    /**
     * 报送批量结束，保存BDP_INTERFACE_JOB监控接口表
     */
    void createXibEndLog();

    /**
     * 生成大数据监控数据
     * @param tableName
     * @param num
     * @param busiDate
     */
    void buildBdpInterfaceJobTable(String tableName, Integer num, Date busiDate);

    /**
     * 根据客户信息统计客户当日还款信息
     * 当日还款信息明细FTP供数-借据维度
     * @param repayDtlCi
     * @return
     * @throws TxnException
     */
    CmInteCoLonRepayDtlCi assemRepayDtlCi(CmInteCoLonRepayDtlCi repayDtlCi) throws TxnException;

    /**
     * 贷款信息FTP供数-借据维度
     * @param loanInfoCi
     * @return
     * @throws TxnException
     */
    CmInteCoLonInfoCi assemLoanInfoCi(CmInteCoLonInfoCi loanInfoCi) throws TxnBizException;

    /**
     * 修改贷款信息已还期数
     * @param item
     * @return
     */
    CmInteCoLonRepayDtl modifyLoanInfo(CmCustomerFirstLevel item);
}
